package com.athui.enums;

import java.util.regex.Pattern;

/**
 * @description: TODO 正则匹配枚举
 * @autor: zhangzhonghui
 * @create: 2024-08-22 12:29
 * @Version: 1.0
 */
public enum DataRegularEnums {

    TEXT_PHONE_REGULAR(Pattern.compile("^1[3456789]\\d{9}$"),"手机号"),
    TEXT_SQL_PARAMS_PATTERN(Pattern.compile("\\$\\{([^}]*)\\}"),"sql参数占位符匹配"),
    TEXT_XML_PATTERN(Pattern.compile(".+\\.xml$"),"xml文件检查"),
    TEXT_COLUMN_NAME_PATTERN(Pattern.compile("(\\w+)\\(([^)]+)\\)"),"列名解析正则表达式"),

    NUMERICAL_IS_NUMERICAL(Pattern.compile("^[-+]?((\\d+(\\.\\d*)?)|(\\.\\d+))$"),"正则校验是否为数字，包括正整数、负整数、浮点数等");

    private Pattern pattern;
    private String desc;

    DataRegularEnums(Pattern pattern,String desc) {
        this.pattern = pattern;
        this.desc = desc;
    }

    public Pattern getValue(){
        return pattern;
    }
}
